<?php

namespace App\Models;

use App\Models\Goods;
use App\Models\Server;
use App\Models\Char;
use Illuminate\Database\Eloquent\Model;

class Character extends Model
{
    protected $connection = 'mysql_char';
    protected $table = 'characters';
    protected $primaryKey = 'guid';
    public $timestamps = false;

//    use WowModel;

    public function SendItem(Server $server,$subject,$text,Goods $goods,$count,&$res,&$err){
        $command= '.send items '.$this->name.' "'.$subject.'" "'.$text.'" '.$goods->item_id.':'.$count;
        return $server->RunCommand($command,$res,$err);
    }

    public function SendMoney(Server $server,$subject,$text,$count,&$res,&$err){
        $command= '.send money '.$this->name.' "'.$subject.'" "'.$text.'" '.$count;
        return $server->RunCommand($command,$res,$err);
    }
}
